package csci4448.android.workouttracker;

import android.os.Bundle;
import android.app.TabActivity;
import android.content.Intent;
import android.view.Menu;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

@SuppressWarnings("deprecation")
public class MainActivity extends TabActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        TabHost tabHost = getTabHost();
        
        // Tab for Recording
        TabSpec record = tabHost.newTabSpec("Record");
        record.setIndicator("Record");
        Intent photosIntent = new Intent(this, RecordTabActivity.class);
        record.setContent(photosIntent);
 
        // Tab for Viewing Sessions
        TabSpec view = tabHost.newTabSpec("View Sessions");
        view.setIndicator("View Sessions");
        Intent songsIntent = new Intent(this, ViewTabActivity.class);
        view.setContent(songsIntent);
 
        // Tab for Personal Stats
        TabSpec personal = tabHost.newTabSpec("Personal");
        personal.setIndicator("Personal");
        Intent videosIntent = new Intent(this, PersonalTabActivity.class);
        personal.setContent(videosIntent);
 
        // Adding all TabSpec to TabHost
        tabHost.addTab(record); // Adding photos tab
        tabHost.addTab(view); // Adding songs tab
        tabHost.addTab(personal); // Adding videos tab
        
        tabHost.setCurrentTab(0);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
}
